package com.mydomain.Bodega;

import com.mydomain.Bodega.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("pgBuffercacheHome")
public class PgBuffercacheHome extends EntityHome<PgBuffercache> {

	public void setPgBuffercacheId(PgBuffercacheId id) {
		setId(id);
	}

	public PgBuffercacheId getPgBuffercacheId() {
		return (PgBuffercacheId) getId();
	}

	public PgBuffercacheHome() {
		setPgBuffercacheId(new PgBuffercacheId());
	}

	@Override
	public boolean isIdDefined() {
		if (getPgBuffercacheId().getBufferid() == null)
			return false;
		if (getPgBuffercacheId().getIsdirty() == null)
			return false;
		if (getPgBuffercacheId().getRelblocknumber() == null)
			return false;
		if (getPgBuffercacheId().getReldatabase() == null)
			return false;
		if (getPgBuffercacheId().getRelfilenode() == null)
			return false;
		if (getPgBuffercacheId().getReltablespace() == null)
			return false;
		if (getPgBuffercacheId().getUsagecount() == null)
			return false;
		return true;
	}

	@Override
	protected PgBuffercache createInstance() {
		PgBuffercache pgBuffercache = new PgBuffercache();
		pgBuffercache.setId(new PgBuffercacheId());
		return pgBuffercache;
	}

	public void wire() {
		getInstance();
	}

	public boolean isWired() {
		return true;
	}

	public PgBuffercache getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

}
